<?php
namespace App\Services\User;

use App\Models\User;

class FocusRecService {

    public static function handle() {
        $latest_user_id = \Cache::remember('latest_user_key', 5, function () {
            return User::orderBy('id', 'desc')->limit(2)->pluck('id')->all();
        });
        $hot_user_id = \Cache::remember('hot_search_user_key', 60*24, function () {
            return User::where('top_hot_search_height_100', 1)->inRandomOrder()->take(4)->pluck('id')->all();
        });
        return array_unique(array_merge($latest_user_id, $hot_user_id));
    }
}